package com.hs.sfzy.mapper;

import com.hs.sfzy.entity.UserCourse;
import org.apache.ibatis.annotations.Delete;

import java.util.List;
/**
 * @description: 课程收藏mapper层
 * @author shanglin
 * @date 2024/10/25 9:16
 */
public interface UserCourseMapper {

    List<UserCourse> selectAll(UserCourse userCourse);

    UserCourse selectById(Long id);

    List<UserCourse> selectByUserId(Long id);

    @Delete("delete from user_course where id = #{id}")
    int deleteById(Long id);

    // 收藏本课程的userid数组
    List<UserCourse> selectByCourseId(Long id);

    int insert(UserCourse userCourse);

    int deleteByCourseIdAndUserId(UserCourse userCourse);

    Integer countUserCourseByCourseId(Long courseId);
}
